#!/usr/bin/python
# -*- coding: GBK -*-
import GameWorld
import GameComm
import math
import random
m_count=0
changeAngle=0
curDir=1
def ProcessAI(UnitHandle):
    global m_count
    global changeAngle
    global curDir
    m_count+=1
#    ScreenWidth=GameWorld.IPY_GameWorld().GetSceneWidth()
#    ScreenHeight=GameWorld.IPY_GameWorld().GetSceneHeight()
    myInfo = GameWorld.IPY_GameWorld().GetUnitInfo(UnitHandle)
    rollPerAi= (myInfo.AITick-20)*2/myInfo.RollSpeed
    MovePerAi=myInfo.AITick/myInfo.MoveSpeed
    if m_count>=5:
        m_count=0
        if changeAngle>=180:
            curDir=curDir%2+1
            changeAngle=0
        changeAngle+=rollPerAi
        return "%s %s"%(curDir,rollPerAi)
        
    else:
        m_count+=1;
        return "3 %s"%MovePerAi
